<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>确认验证码</title>
</head>
<body>

<?php  
	if (isset($_REQUEST['authcode'])) {
		session_start();

		// 将用户输入全部转为小写在做对比
		if (strtolower($_REQUEST['authcode'])== $_SESSION['authcode']) {
			echo '<font color="#0000CC">输入正确</font>';
		}else{
			echo '<font color="#CC0000">输入错误</font>';
		}
		exit();
	}

?>

	<form action="./form.php">
		<p>验证码图片：<img id="captcha_img" border="1" src="./fontCaptcha.php?r=<?php echo rand();?>" width="200" height = "50" alt="">
		<a href="javascript:void(0)" onclick="document.getElementById('captcha_img').src = './fontCaptcha.php?r='+Math.random()">换一个？</a>
		</p>

		<p>请输入图片中的内容：<input type="text" name="authcode" value=""></input></p>
		<p><input type="submit" value="提交" style="padding: 6px 20px;"></p>
	</form>
</body>
</html>